package com.example.lycdays.data.bean;
import org.litepal.crud.LitePalSupport;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Event extends LitePalSupport implements Serializable {

    //id, 主键自增长
    private int id;
    //用户名
    private String userName;
    //事件名
    private String eventName;
    //事件创建时间，Unix 时间戳
    private long createTime;
    //事件设定的日期
    private String eventDate;
    //事件备注
    private String eventNotes;

    public Event() {
    }

    public Event(String eventName, Date eventDate, String eventNotes) {
        this.eventName = eventName;
        this.createTime = new Date().getTime();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        this.eventDate = format.format(eventDate);
        this.eventNotes = eventNotes;
    }

    public Event(String eventName, String eventDate, String eventNotes) {
        this.eventName = eventName;
        this.createTime = new Date().getTime();
        this.eventDate = eventDate;
        this.eventNotes = eventNotes;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getEventDate() {
        return eventDate;
    }

    public void setEventDate(String eventDate) {
        this.eventDate = eventDate;
    }

    public String getEventNotes() {
        return eventNotes;
    }

    public void setEventNotes(String eventNotes) {
        this.eventNotes = eventNotes;
    }

    public String getEventName() {
        return eventName;
    }

    public void setEventName(String eventName) {
        this.eventName = eventName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}

